const USER_STATE = {
    accesstoken: null,   // 用户密钥    5a5429d7-d22d-4daf-ac57-e45984fe9b38
} 

export default function user(prestate=USER_STATE, action) {
    switch(action.type) {
        case 'loginSuccess':
            return {...prestate, accesstoken: action.accesstoken, loginname: action.loginname};
        case 'loginFail':
            return {...prestate, accesstoken: action.accesstoken, loginname: action.loginname};
        default:
        return {...prestate};
    }
}